package com.cai.oamanager.entity;

import lombok.Data;
import lombok.Value;

/**
 * @version 1.0
 * @author：蔡松坡
 * @date：2021/1/18 19 : 41
 * @package：com.cai.oamanager.dao
 * 封装的分页类
 */
@Data
public class PageUtil {
    private Integer currentPage;   //当前页
    private Integer size;   //每页显示条数
    private Integer total;  //总条数
    private Integer totalPage;  //总页数
    private Integer start;   //起始页


    public void startPage(){
        this.start = (this.currentPage-1)*this.size;
    }

    public void totalNumPage(){
//        this.totalPage = this.total==0?1:total;
        this.totalPage = this.total==0?1:(this.total%this.size==0?this.total/this.size:this.total/this.size+1);
    }


}
